package site.syksy.qingzhou.setting.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import site.syksy.qingzhou.setting.domain.DicDO;
import site.syksy.qingzhou.setting.mapper.DicMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Raspberry
 * @since 2021-01-04
 */
@Service
public class DicService extends ServiceImpl<DicMapper, DicDO> {

    /**
     * 根据名字查询字典类目
     * @param name
     * @return
     */
    public List<DicDO> listByName(String name){
        QueryWrapper<DicDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(DicDO::getName,name);
        return list(queryWrapper);
    }

}
